package com.example.flower_shop.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;

@Data
@Entity
@Table(name = "review_replies")
@EqualsAndHashCode(callSuper = true)
public class ReviewReply extends BaseEntity {

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id", nullable = false)
    private User user;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "review_id", nullable = false)
    private Review parentReview;

    @Column(name = "content", nullable = false, columnDefinition = "text")
    private String content;

    @Column(name = "likes_count")
    private Integer likesCount = 0;
}